package com.zr.service.driverclient.impl;

import com.zr.dao.dispatch.DispatchAbnormalRecordDao;
import com.zr.dao.dispatch.DispatchMaintenanceDao;
import com.zr.dao.dispatch.DispatchTicketDao;
import com.zr.service.driverclient.MsgService;
import com.zr.vo.dispatch.DispatchAbnormalRecord;
import com.zr.vo.dispatch.DispatchMaintenance;

import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MsgServicerImpl implements MsgService {
    //异常dao
    @Resource
    private DispatchAbnormalRecordDao dispatchAbnormalRecordDao;
    //维修单dao
    @Resource
    private DispatchMaintenanceDao dispatchMaintenanceDao;

    /**
     * 获取异常消息
     *
     * @param carNumber
     * @return
     */
    @Override
    public List<DispatchAbnormalRecord> getAbnList(String carNumber) {
        return dispatchAbnormalRecordDao.getAbnList(carNumber);
    }

    /**
     * 获取维保消息
     *
     * @param carNumber
     * @return
     */
    @Override
    public List<DispatchMaintenance> getMtList(String carNumber) {
        return dispatchMaintenanceDao.getMtList(carNumber);
    }

    /**
     * 更新维保状态
     *
     * @param dispatchMaintenance
     * @return
     */
    @Override
    public int editMtStatus(DispatchMaintenance dispatchMaintenance) {
        return dispatchMaintenanceDao.updateByPrimaryKeySelective(dispatchMaintenance);
    }
}
